package com.xk.androiddemo.ui.dashboard;

import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel;

import com.xk.androiddemo.model.MonitorDataItem;
import com.xk.androiddemo.utils.UIUtils;

public class DashboardViewModel extends ViewModel {
    MutableLiveData<MonitorDataItem> data = new MutableLiveData<>();
    public DashboardViewModel() {
       MonitorDataItem monitorDataItem = UIUtils.generateRandomDataItem();
       data.postValue(monitorDataItem);
    }

    public void createData(){
        MonitorDataItem monitorDataItem = UIUtils.generateRandomDataItem();
        data.postValue(monitorDataItem);
    }

}